package javase.javase01.exercise02;

/**
 * @author: Gan
 * @date 2021/4/14 0014 21:46
 * @description:
 **/
public class DemoThread {


    public static void main(String[] args) {
        MyThread mt = new MyThread();
        //mt.setName("小明");
        //开启新线程
        mt.start();
        for (int i = 0; i < 20; i++) {
            System.out.println("main -->" + i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
       // new MyThread("晓东").start();
        //获取主线程main
        System.out.println(Thread.currentThread().getName());
    }
}
